package obsolet;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;

import org.xml.sax.*;
import org.xml.sax.helpers.*;


import javax.xml.parsers.*;

public class XML_Parser_sch extends DefaultHandler {
	private SAXParserFactory factory = SAXParserFactory.newInstance();
	private SAXParser saxParser = null;
	String[] result = {};
	
	public XML_Parser_sch(InputStream obj){
		try {
			saxParser = factory.newSAXParser();
		} catch (ParserConfigurationException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		} catch (SAXException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		parse(obj);	}
		
	public String[] parse(InputStream obj){
		try {
			saxParser.parse(obj, this);
			System.out.println("huhu");
		} catch (SAXException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println(result[0]);
		return result;
	}
	
}
